package org.dromara.xxmj.service.impl;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.convert.Convert;
import com.alibaba.excel.util.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import jakarta.annotation.Resource;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.dromara.common.core.domain.model.LoginUser;
import org.dromara.common.core.exception.ServiceException;
import org.dromara.common.satoken.utils.LoginHelper;
import org.dromara.xxmj.domain.*;
import org.dromara.xxmj.domain.dto.ExerciseSubmitDto;
import org.dromara.xxmj.domain.dto.GetQuestionListDTO;
import org.dromara.xxmj.domain.dto.SimulationSubmitDTO;
import org.dromara.xxmj.domain.po.UserCollectQuestionInfo;
import org.dromara.xxmj.domain.po.UserErrorQuestionInfo;
import org.dromara.xxmj.domain.vo.*;
import org.dromara.xxmj.mapper.*;
import org.dromara.xxmj.service.XxmjAdminService;
import org.dromara.xxmj.service.XxmjExercisesService;
import org.dromara.xxmj.utils.CheckUtils;
import org.dromara.xxmj.utils.ConvertUtils;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 小巷密卷用户扩展Service业务层处理
 *
 * @author Lion Li
 */
@RequiredArgsConstructor
@Service
@Slf4j
public class XxmjAdminServiceImpl implements XxmjAdminService {

    @Resource
    private CourseVideoMapper courseVideoMapper; //课后视频库

    @Resource
    private CourseExerciseMapper courseExerciseMapper;//课后习题题库

    @Resource
    private CourseSimulationMapper courseSimulationMapper;//模拟题库

    @Resource
    private UserErrorQuestionInfoMapper userErrorQuestionInfoMapper;

    @Resource
    private UserCollectQuestionInfoMapper userCollectQuestionInfoMapper;

    @Resource
    private UserExerciseRecordMapper userExerciseRecordMapper;

    @Resource
    private ConvertUtils convertUtils;

    @Resource
    private CheckUtils checkUtils;


    @Override
    public List<CourseVideoVo> chapterVideoList(String courseId) {
        if (StringUtils.isBlank(courseId)){
            courseId = "1";
        }
        return courseVideoMapper.selectVoList(Wrappers.<CourseVideo>lambdaQuery()
            .eq(CourseVideo::getCourseId, courseId));
    }






}





